﻿package mortal.game.view.mount
{
    import Message.Public.*;
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.component.window.*;
    import mortal.game.view.mount.newMountModuel.*;
    import mortal.game.view.mount.panel.*;

    public class MountModule extends GSprite
    {
        private var _currentPanel:MountBasePanel;
        private var _window:Window;

        public function MountModule(param1:Window)
        {
            this._window = param1;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.changeTabBar(0);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._currentPanel.dispose(param1);
            this._currentPanel = null;
            super.disposeImpl(param1);
            return;
        }// end function

        private function addMountInfoPanel() : MountInfoPanel
        {
            var _loc_1:MountInfoPanel = null;
            _loc_1 = UICompomentPool.getUICompoment(MountInfoPanel, this._window);
            _loc_1.x = -5;
            this.addChild(_loc_1);
            this._currentPanel = _loc_1;
            return _loc_1;
        }// end function

        public function changeTabBar(param1:int) : void
        {
            var _loc_2:MountBasePanel = null;
            if (this._currentPanel && this._currentPanel.parent)
            {
                this._currentPanel.dispose();
            }
            switch(param1)
            {
                case 0:
                {
                    _loc_2 = this.addMountInfoPanel();
                    break;
                }
                case 1:
                {
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function blessUpdate() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).blessUpdate();
            }
            return;
        }// end function

        public function updateMountInfo() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).updateMountInfo();
            }
            return;
        }// end function

        public function autoLevelUpHandler() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).levelUpHandler();
            }
            return;
        }// end function

        public function cancelAutoLevelUp() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).cancelAutoLevelUp();
            }
            return;
        }// end function

        public function updateEquip() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).updateEquip();
            }
            return;
        }// end function

        public function updateMountSharpItem() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).updateMountSharpItem();
            }
            return;
        }// end function

        public function updateAttrData() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).updateAttrData();
            }
            return;
        }// end function

        public function showBtnFilter() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).showBtnFilter();
            }
            return;
        }// end function

        public function updateMountItem() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).updateMountItem();
            }
            return;
        }// end function

        public function updateMountSelect() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).updateMountSelect();
            }
            return;
        }// end function

        public function updateVip() : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).updateVip();
            }
            return;
        }// end function

        public function updateSkill(param1:SSkill) : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).updateSkill(param1);
            }
            return;
        }// end function

        public function shapeCardStatUpdate(param1:Boolean) : void
        {
            if (this._currentPanel is MountInfoPanel)
            {
                (this._currentPanel as MountInfoPanel).shapeCardStatUpdate(param1);
            }
            return;
        }// end function

    }
}
